package com.jiukuaidao.zhulin.module.commodity.model;

import android.content.Context;

import com.jiukuaidao.library.net.IApi;
import com.jiukuaidao.zhulin.entity.ApiSortCatList;
import com.jiukuaidao.zhulin.entity.ApiSortPros;
import com.jiukuaidao.zhulin.entity.EventShoppingCartInfo;
import com.jiukuaidao.zhulin.module.commodity.contract.SortProContract;

import java.util.List;

/**
 * Author : H_Joker
 * Date : 2016/6/6
 * Description :
 */
public class SortProModel implements SortProContract.Model {

    private Context mContext;

    private ApiSortCatList.ApiSortCateListItem mCateInfo;

    private int mCurrentPageIndex = 1;

    private List<ApiSortPros.ApiSortProItem> mProList;

    private List<EventShoppingCartInfo> mShoppingCart;

    public SortProModel(Context context) {
        mContext = context;
    }


    @Override
    public void loadData(IApi api) {
        loadData(api, true);
    }

    @Override
    public void loadData(IApi api, boolean isBuildParams) {
        loadData(api, isBuildParams, false);
    }

    @Override
    public void loadData(IApi api, boolean isBuildParams, boolean aes) {
        if (isBuildParams)
            api.buildBaseParams();

        if (aes)
            api.aes();
        api.start();
    }

    @Override
    public void setCateInfo(ApiSortCatList.ApiSortCateListItem cateInfo) {
        mCateInfo = cateInfo;
    }

    @Override
    public ApiSortCatList.ApiSortCateListItem getCateInfo() {
        return mCateInfo;
    }

    @Override
    public void setCurrenPageIndex(int currenPageIndex) {
        mCurrentPageIndex = currenPageIndex;
    }

    @Override
    public int getCurrentPageIndex() {
        return mCurrentPageIndex;
    }

    @Override
    public void setPros(List<ApiSortPros.ApiSortProItem> list) {
        mProList = list;
    }

    @Override
    public List<ApiSortPros.ApiSortProItem> getPros() {
        return mProList;
    }

    @Override
    public void setShoppingCart(List<EventShoppingCartInfo> datas) {
        mShoppingCart = datas;
    }

    @Override
    public List<EventShoppingCartInfo> getShoppingCart() {
        return mShoppingCart;
    }

}
